#!/bin/bash
#
# Generate STL from INDEX
#
for name in $(egrep -v '^#' index.txt)
do
    stl=${name}.stl
    scad=${name}.scad

    if openscad -o ${stl} ${scad}
    then
        git add ${stl}
        ls -l ${stl}
    else
        cat<<EOF>&2
Error from 'openscad -o ${stl} ${scad}'
EOF
        exit 1
    fi
done
